﻿using System.Web;

using gbL.NetBoard;

namespace NiggleAmp.Services
{
    public static class HubService
    {
        public static IHub Hub
        {
            get
            {
                if (!HttpContext.Current.Items.Contains("NAmp-hub"))
                {
                    HttpContext.Current.Items.Add("NAmp-hub", new Hub());
                }

                return (IHub)HttpContext.Current.Items["NAmp-hub"];
            }
        }

        public static IWire BuildWire()
        {
            return Wire.To(Hub);
        }
    }
}
